﻿using Cms.Core.Data.Mapping;
using Cms.Core.Data.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace Cms.Core.Data.Configurations
{
    public class SysTokenConfigurations : EntityMappingConfiguration<SysToken>
    {
        public override void Map(EntityTypeBuilder<SysToken> builder)
        {

            base.MapCommon(builder);
            builder.Property(b => b.Token).HasColumnType("nvarchar(600)").IsRequired(true);
            builder.Property(b => b.ExpirationTime).IsRequired(true);
            builder.Property(b => b.RefreshTime).IsRequired(false);
            builder.Property(b => b.RefreshToken).HasColumnType("nvarchar(600)").IsRequired(false);
            //builder.Property(b => b.IsEnabled).HasDefaultValue(true).IsRequired(true);
            builder.ToTable("SysToken");
        }
    }
}
